import { http,domain  } from "@/utils/http";
export type Result = {
    code: number;
    msg: string;
    data: any;
}
export type UpResult = {
  code:number;
  url:string;
}

export const addObj = (data?: object) => {
  return http.request<Result>("post", domain+"/rquser/add", { data });
};


export const deleteObj = (params?: object) => {
    console.log("data",params);
    return http.request<Result>("get", domain+"/rquser/delete", { params });
}

export const updateObj = (data?: object) => {
    return http.request<Result>("post", domain+"/rquser/update", { data });
}


export const listObjs = (params?: object) => {
  return http.request<Result>("get", domain+"/rquser/list", { params });
};
export const getObj = (params?: object) => {  
    return http.request<Result>("get", domain+"/rquser/get", { params });
}


export const uploadHeaderImg = (data?: object) => {
  console.log("data",data);
  return http.upFile<UpResult>(domain+"/fileupload", { data });
}

